package com.soft863.ct.consumer.bean;

import com.soft863.tc.common.api.Column;
import com.soft863.tc.common.api.RowKey;
import com.soft863.tc.common.api.TableRef;
import com.soft863.tc.common.constant.ValueConstant;

@TableRef(ValueConstant.TABLE_NAME)
public class CallLog {
    @RowKey
    private String rowKey;
    @Column(family = ValueConstant.COLUMN_FAMILY)
    private String calling;
    @Column(family = ValueConstant.COLUMN_FAMILY)
    private String called;
    @Column(family = ValueConstant.COLUMN_FAMILY)
    private String callTime;
    @Column(family = ValueConstant.COLUMN_FAMILY)
    private String duration;

    public CallLog() {
    }


    public CallLog(String value) {
        String[] values = value.split("\t");
        calling = values[0];
        called = values[1];
        callTime = values[2];
        duration = values[3];
    }

    public String getRowKey() {
        return rowKey;
    }

    public void setRowKey(String rowKey) {
        this.rowKey = rowKey;
    }

    public String getCalling() {
        return calling;
    }

    public void setCalling(String calling) {
        this.calling = calling;
    }

    public String getCalled() {
        return called;
    }

    public void setCalled(String called) {
        this.called = called;
    }

    public String getCallTime() {
        return callTime;
    }

    public void setCallTime(String callTime) {
        this.callTime = callTime;
    }

    public String getDuration() {
        return duration;
    }

    public void setDuration(String duration) {
        this.duration = duration;
    }

    @Override
    public String toString() {
        return calling + '\t' + called + '\t' + callTime + '\t' + duration;
    }
}
